home *** CD-ROM | disk | FTP | other *** search
/ NBC Slam Jams! / NBC Slam Jams!.iso / xtras / media_la / fx_set_1.fxm / 00191_Script_Mode Buttons < prev    next >
Text File  |  1998-01-20  |  2KB  |  86 lines

  1. property pSpriteList, pCurActive, pCallBackObj, pRefcon
  2.  
  3. on new me, propList
  4.   set pSpriteList = getAProp(propList,#sprites)
  5.   set pCurActive = getAProp(propList,#cur)
  6.   set pCallBackObj = getAProp(propList,#callback)
  7.   set pRefCon = getAProp(propList,#ref)
  8.   
  9.   SetActive(me, pCurActive)
  10.   
  11.   if pCurActive > count(pSpriteList) then set pCurActive = 0
  12.   return(me)
  13. end
  14.  
  15. on Click me, sNum
  16.   if not integerP(sNum) then set sNum = the clickOn
  17.   if the memberNum of sprite sNum < 1 then exit
  18.   if not (the name of the member of sprite sNum contains "mode") then exit
  19.   
  20.   put the name of the member of sprite sNum into memName
  21.   
  22.   
  23.   if memName contains "down" then exit
  24.   
  25.   set the member of sprite sNum = member (memName&&"Down")
  26.   updateStage
  27.   set selected = TRUE
  28.   
  29.   repeat while the stillDown
  30.     if rollover(sNum) then
  31.       set the member of sprite sNum = member (memName&&"Down")
  32.       set selected = TRUE
  33.     else
  34.       set the member of sprite sNum = member (memName)
  35.       set selected = FALSE
  36.     end if
  37.     updateStage
  38.   end repeat
  39.   
  40.   put getPos(pSpriteList,sNum) into newNum
  41.   
  42.   SetActive(me,newNum)
  43.   if objectP(pCallBackObj) then
  44.     put word 1 of memName into name
  45.     delete char 1 to 4 of name
  46.     changeMode(fxCurObj,value("#"&name))
  47.   end if
  48.   return(pCurActive)
  49. end
  50.  
  51. on SetActive me, newNum
  52.   set pCurActive = newNum
  53.   repeat with i = 1 to count(pSpriteList)
  54.     put getAt(pSpriteList,i) into sNum
  55.     puppetSprite sNum, TRUE
  56.     put word 1 of the name of the member of sprite sNum into memname
  57.     if i = pCurActive then
  58.       set the member of sprite sNum = member (memname&&"Down")
  59.     else
  60.       set the member of sprite sNum = member memname
  61.     end if
  62.   end repeat
  63.   --updateStage
  64. end 
  65.  
  66. on ThisYou me, sNum
  67.   repeat with i = 1 to count(pSpriteList)
  68.     if(getAt(pSpriteList, i) = sNum) then
  69.       return TRUE
  70.     end if
  71.   end repeat
  72.   return FALSE
  73. end
  74.  
  75. on GetActiveMode me
  76.   return(pCurActive)
  77. end
  78.  
  79. on Release me
  80.   repeat with i = 1 to count(pSpriteList)
  81.     puppetSprite getAt(pSpriteList,i), FALSE
  82.   end repeat
  83. end
  84.  
  85.  
  86.